//
//CGameBrowserLeftSizedPanel used to resize Panel
//
#pragma once

//#include "StandardHostTypeDefine.h"

class CGameBrowserLeftSizedPanel: public CWnd
{
    typedef struct _GBButtonItemInfo
    {
        CRect rcPosition;
        BOOL  bMouseHoverd;
        BOOL  bWindowCollapsed;
    }BButtonItemInfo,*PBButtonItemInfo;


    DECLARE_DYNAMIC(CGameBrowserLeftSizedPanel)
public:
    CGameBrowserLeftSizedPanel();
     virtual ~CGameBrowserLeftSizedPanel();

public:
    //set size
    void SetSize(CSize sz){ m_cContainerSize = sz;}
    CSize GetSize(){ return m_cContainerSize;}

    //Let child the change its child window
    virtual void AfterSizeChanged(){};

    void SetPanelControl(CWnd *pChild);
    void RemovePanelControl();

private:
    BOOL CheckValidateInput(POINT point);
    void DrawSplitterLine(POINT pt,BOOL bRemoveOld = FALSE);
    BOOL ChangeClientWindowSize(POINT ptClient);

    //ReDraw

    void PaintOnMemoryDC(CDC &hdcMem);

protected:
    //StandardHostPanelState m_currentState;
    //StandardHostPanelType  m_shpType;

    CSize m_cContainerSize;

    CWnd *m_pPanelControl;

private:
    
    BOOL  m_bEnterDragChangeSize;
    POINT m_OldSplitterPoint;

    CPoint m_cLButtonDownBeginPoint;

    BOOL m_bValidateInput;
    BOOL m_bInputIsValidate;

    //CRect m_bButtonPosition;

    PBButtonItemInfo    m_pButtonItemInfo;

protected:
    DECLARE_MESSAGE_MAP()

    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 
    afx_msg LRESULT OnNcHitTest(CPoint point);

    afx_msg BOOL OnEraseBkgnd(CDC*);


    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnSizing(UINT fwSide, LPRECT pRect);

    afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
    afx_msg void OnMouseMove(UINT nFlags, CPoint point);
    afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
    afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
    afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
    afx_msg void OnPaint();

    afx_msg LRESULT OnIdleUpdateCmdUI(WPARAM wParam, LPARAM lParam);
    //afx_msg LRESULT OnChangePanelControlSize(WPARAM wParam,LPARAM lParam);

};